
#ifndef __LOG_APPENDER_HPP__
#define __LOG_APPENDER_HPP__

#include    "tiny/loglevel.hpp"
#include    "tiny/logrecord.hpp"

namespace   tiny
{

class   LogAppender
{

public  :
    LogAppender() : m_min_loglevel(LogLevel::INFO), m_max_loglevel(LogLevel::FATAL)
    {
    }

    virtual ~LogAppender() 
    {
    }

public  :

    virtual int     append( const LogRecord& ) = 0;

    void    setMinLogLevel( int iLogLevel ) { m_min_loglevel = iLogLevel; }
    int     getMinLogLevel( void ) const { return m_min_loglevel; }

    void    setMaxLogLevel( int iLogLevel ) { m_max_loglevel = iLogLevel; }
    int     getMaxLogLevel( void ) const { return m_max_loglevel; }

private :

    int   m_min_loglevel;
    int   m_max_loglevel;

};  // class LogAppender

}   // namespace tiny

#endif  // __LOG_APPENDER_HPP__

